package czy.demo.component;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class PropertiesValueComponent implements InitializingBean {

    private static final Logger logger = LoggerFactory.getLogger(PropertiesValueComponent.class);

    @Value("${number1}")
    private Integer number1;

    @Value("${number2}")
    private Long number2;

    @Value("${number3}")
    private Integer number3;

    @Value("${number4}")
    private Integer number4;

    @Value("${uuid}")
    private String uuid;

    @Override
    public void afterPropertiesSet() throws Exception {
        logger.info("随机整数为："+number1);
        logger.info("随机长整型为："+number2);
        logger.info("随机小于10整数为:"+number3);
        logger.info("随机100-200之间整数为："+number4);
        logger.info("随机uuid为："+uuid);
    }
}
